"The Bank Robber" by Artur & Huang

The time of day is 03:00 PM.

[places]
The entrance hall is a room. "Automatic Teller machines forming two L-shaped rows, a dark green glass door and a small booth for a security guard(empty at the moment): definitly not much to do here. From here the squad cars are visible and you're an easy target since your so exposed."
The main room is a room. "This huge room is divided in one area for the clients in line and another for the bank tellers. People come here frequently to pay their bills and the queues can be so long they surpass the limits of the bank's walls during rush hour. There's nothing of much interest here, now that you've moved everyone that was here to the Employee's Room."
The employee's room is a room. "This room is divided by cubicles and desks, each with it's own computer. Many bank employees work here, serving customers, performing calculations and typing reports. Now, the people that are kept hostage are sitting on the floor, close to each other, doing nothing that could concern you."
The safe is a room.
The security room is a room.
The women's bathroom is a room. "A single female bathroom, with a lavatory and a mirror. Walls with lightly colored tiles, the pleasent scent of cleanliness and nothing else."
The men's bathroom is a room. "A singe male bathroom, with a lavatory and a mirror. Walls with dark colored tiles, a reasonable scent of cleanliness and nothing else."
The parking lot is a room. "A once abandoned lot, now full of gravel to cover the bare land and surrounded by an iron fence, this space is meant for the employees only. You can see many cars, clearly distinguishing the finantial status of each employee, from the cheaper models to a few luxury vehicles. To the east you see a shed where someone would be, drinking coffe, listening to the radio and keeping an eye on the cars, but when whoever usualy stays there heard the commotion caused by the police he or she left, leaving the place empty. You can se some of the squad cars, and many who stand there notice your presence."
The main street is a room.
The empty street is a room.
The cabin is a room.

[kinds]
A staircase is a kind of door. A staircase is always open.

A window is a kind of door. A window is never locked.

A telephone is a kind of thing.

[properties]
A person is either dead or alive. A person is usually alive. A man is usually alive. A woman is usually alive.
A woman is either ordinary or hot. A woman is usually ordinary.
A door is either ordinary or passworded. A door is usually ordinary.
A person is either safe_not_unlocker or safe_unlocker. A person is usually safe_not_unlocker. A man is usually safe_not_unlocker. A woman is usually safe_not_unlocker.
A thing is either heavy or light. A thing is usually light.
A container is either normal or huge. A container is usually normal.
A door is either breakable or unbreakable. A door is usually unbreakable.
A person is either not hostage or hostage. A person is usually not hostage. A woman is usually not hostage. A man is usually not hostage.

[characters]
The player is in the employee's room.
The carrying capacity of the player is 4.
The manager is a hostage man. He is safe_unlocker.
The manager is in the employee's room.
The security chief is a hostage man.
The security chief is in the employee's room.
The lady is a hot hostage woman.
The lady is in the employee's room.

The cops are in the main street.
The cops are people.
The major is a woman.
The Negotiator is in the main street.
The major is in the main street.
The Negotiator is a man.

The boss is a man.

Persuasion rule for asking a alive hostage to try going somewhere: persuasion succeeds.
Persuasion rule for asking a alive hostage to try dropping something: persuasion succeeds.

Persuasion rule for asking a dead hostage (called X) to try going somewhere:
	say "[X] is dead.";
	persuasion fails.
Persuasion rule for asking a dead hostage (called X) to try dropping something:
	say "[X] is dead.";
	persuasion fails.

[items]
The player carries a gun.
The player is wearing a mask.
The player is wearing a watch.
The player is wearing pants.
pants is a container.
The carrying capacity of the pants is 2.
The mask is wearable.
The manager is wearing a coat.
The coat contains the key card.
The carrying capacity of the coat is 2.
lot of money is in the safe. It is heavy.
The mobile is a telephone. It is carried by the player.
The map is in the security room.
The lady carries a bag.
The bag is a closed container.
The bag is openable.
The bag contains stuff.
The bag is huge.
The stuff is heavy.
The table is in the cabin.
The sweet is on the table.
The sweet is edible.
In the parking lot is a closed vehicle called the security chief's car.
The key chain unlocks the security chief's car.
The security chief's car is locked.
The security chief carries the key chain.

[figures]
Figure of cops is the file "cops.jpg".
Figure of mask is the file "mask.jpg".
Figure of death is the file "iml.jpg".
Figure of map is the file "map.jpg".

The maximum score is 10.

[Understands]
Understand "kill [someone]" as attacking.
Understand "unwear [something]" as taking off.
Understand "unlock [something]" as unlocking it with. 
Understand "empty [container]" as emptying. Emptying is an action applying to one thing.
Understand "escape by [door]" as escaping. Escaping is an action applying to one thing.

[Carry outs]
Carry out emptying:
	if the player does not carry the noun begin;
		say "[The noun] does not belong to you.";
		stop the action;
	end if;
	if the noun is a container begin;
		say "Removing [list of things inside the noun].";
		now all things inside the noun are in the location;
		say "Now [the noun] is empty.";
	otherwise;
		say "[The noun] is not a container.";
	end if.

Carry out escaping:
	if the player is in a vehicle begin;
		if the noun is a breakable door begin;
			say "You've broken [the noun]!"; 
			now the noun is not locked;
			now the noun is open;
		otherwise;
			say "[the noun] cannot be broken.".
		end if;
	end if.

[doors]
The front door is a locked door. It is south of the entrance hall. It is north of the main street.
The revolving door is a open door. It is north of the entrance hall. It is south of the main room.
The up stairs is a staircase. It is north of the main room. It is above the main room. Through it is the second floor.
The employee's room door is a door. It is east of the main room. It is west of the employee's room.
The security door is a locked door. It is lockable. It is north of the employee's room. It is south of the security room. The matching key of the security door is the key card.
The safe's door is a locked door. It is lockable. It is passworded. It is west of the security room. It is east of the safe.
The women's bathroom door is a open door. It is southwest of the employee's room. It is north of women's bathroom. 
The men's bathroom door is a open door. It is southeast of the employee's room. It is north of the men's bathroom.
The parking lot window is a window. It is east of the employee's room. Through it is the parking lot.
The parking lot gate is a locked door. It is south of the parking lot. Through it is the main street.
The cabin door is a open door. It is not openable. It is southwest of the parking lot. It is north of the cabin.
The alternative exit is a breakable locked door. It is east of the parking lot. Through it is the empty street.

[Time]
At 3:01 PM:
	[say "Negotiator: Mature young man, with a calm look on his face and very sensible ways. Always with a cigarette in his mouth, seems to be sure he can convince you to give up. He says he's only interested in the hostage's well-being. The way he quarrels with the major, it seems to be true.";
	say "[paragraph break]Major: Beutiful young woman, with an agressive look in her eyes and a commanding stance. Coordinates the military around you with enviable leadership. Is waiting for you to slip up to go in and solve things the BOPE way.";]
	say "[paragraph break]Someone is calling you in the phone.";
	say "Answer the phone? (yes/no)";
	if the player consents begin;
		say "[paragraph break]---at the phone[paragraph break]Gaspar ( the Negotiator ): Hi, my name is Gaspar. I'm here to help you making the right choices for yourself. There are a lot of BOPE soldiers, just waiting my give up to enter and blow up your head with bullets. There's a gorgeous lady here, Major Veronica and...";
		say "[paragraph break]Veronica ( the Major ): Hey, your fucking piece of shit! Try not harming the hostage otherwise you'll give me the pleasure to try my gun on your ass to see if it fits.";


say "[paragraph break]Gaspar ( the Negotiator ): ..er... she's just waiting for some mistake from your part to take my leadership from this operation. But I'm not interested in tragedy this day and I'm trying to find a peaceful solution. I beg you to release all the hostages until 3:40 pm. Otherwise, I can't assure your safety from BOPE team. Think carefully, please.[paragraph break] ---hangs up[paragraph break]";
	otherwise;
		display Figure of death;
		end the game saying "The cops entered and killed you.";
	end if;

At 3:05 PM: 
	say "Someone is calling you in the phone.";
	say "Answer the phone? (yes/no)";
	if the player consents begin;
		say "[paragraph break]---at the phone[paragraph break]Ernesto ( the Boss ): How did this turned into this madness? Just leave the bank with my money until 4:00 pm and you'll have your family safe at home; I don't mind how you do it. Give me the money and I'll release your family. Otherwise, they'll be dead.[paragraph break] ---hangs up[paragraph break]";
	otherwise;
		end the game saying "You're family is dead.";
	end if;



At 3:40 PM:
	if the lady is not in the main street or the manager is not in the main street or the security chief is not in the main street begin;
	say "Someone is calling you in the phone.";
	say "Answer the phone? (yes/no)";
	if the player consents begin;
		say "[paragraph break]---at the phone[paragraph break]Gaspar ( the Negotiator ): I'm sorry, man. I tried, but your deadline has just elapsed...[paragraph break] ---hangs up[paragraph break]";
		end the game saying "You haven't released all the hostages. The cops entered and killed you.";

	otherwise;
		end the game saying "You haven't released all the hostages. The cops entered and killed you.";

	end if;
end if.

At 4:00 PM: 
	say "Someone is calling you in the phone.";
	say "Answer the phone? (yes/no)";
	if the player consents begin;
		say "[paragraph break]---at the phone[paragraph break]Ernesto ( the Boss ): You simply asked for it...[paragraph break] ---hangs up[paragraph break]";
		say "You hear some shots echoing at the phone, with screams of terror and faint.";
		end the game saying "Your family is dead.";
	otherwise;
		end the game saying "Your family is dead.";
	end if.


[rules]
After deciding the scope of the player while in the employee's room:
	place the major in scope;
	place the negotiator in scope.

Rule for writing a paragraph about the security chief's car:
	say "The security chief Otávio's car, is a cheap model, with a discreet color and worn out tyres. A rosary is hanging from the rear-view mirror where you can see photos of him with his family.".

Rule for writing a paragraph about alive manager:
	say "Manager: Bald man, medium build and mumbling a little. Is clearly in dispair with the situation and isn't shy about accepting anything to get out of here alive.".

Rule for writing a paragraph about alive security chief:
	say "Security chief: Strong middle-aged man, very tall and reasonable. Is very calm when talking to you and the others, possibly because he's gone through tense situations before.".

Rule for writing a paragraph about alive lady:
	say "Ana: Young woman, very pretty, but compleatly tense and hysterical. Is crying and isn't making any sense. Any approach you make only makes it worse.".

Rule for writing a paragraph about the front door: 
	say "I can hear the cops movement next to the front door." .

Rule for writing a paragraph about a dead person (called X):
	say "[X] is dead.".

Rule for supplying a missing second noun while unlocking:
	if the noun is the safe's door begin;
		if the player is safe_unlocker begin;
			now the safe's door is unlocked;
			now the safe's door is open;
			say "You've opened the safe!";
		otherwise;
			say "You don't know the password.";
		end if;
	end if.

[events]
Every turn when time of day is 3:00 pm or time of day is 3:30 pm or time of day is 3:50 pm, say "It's [time of day].".

Instead of wearing the mask:
	award 1 point;
	continue the  action.

Instead of taking off the mask:
	award -1 point;
	continue the action.

Instead of eating the sweet:
	award 1 point;
	continue the action.

Instead of examining cops: display Figure of Cops, one time only.

Instead of examining the mask: 
	if player is not wearing the mask begin;
		display Figure of mask, one time only;
	otherwise;
		continue the action;
	end if.

Instead of attacking the cops:
		display Figure of death;
		end the game saying  "The cops killed you!".

Instead of attacking yourself:
	display Figure of death;
	end the game saying "You killed yourself.".

Instead of showing the gun to the cops:
		display Figure of death;
		end the game saying  "The cops killed you!".

Instead of attacking a alive person:
	say "Do you really wanna kill this citizen? (yes/no)";
	if player consents begin;
		say "[paragraph break]This person is now dead.";
		now the noun is dead;
	otherwise;
		stop the action;
	end if.

Instead of attacking a dead person:
	say "This person is already dead.".

Instead of examining a dead person:
	say "This person is already dead. There is nothing you can do about it.".

Instead of taking something (called X) :
	if X is heavy begin;
		say "It's too heavy to carry.";
		stop the action;
	end if;
	if X is carried by a dead person begin;
		now the player carries X;
		say "You've got [X]";
	otherwise;
		if X is worn by a dead person begin;
			 now the player wears X;
			say "Now you are wearing [X]";
		otherwise;
			continue the action;
		end if;
	end if.

Instead of examining the map:
	display Figure of map, one time only.

Instead of going to the second floor:
	say "You know that there are snipers aiming at the second floor. Are you sure? (yes/no)";
	if player consents begin;
		display Figure of death;
		end the game saying "The cops killed you! Head shot!";
	otherwise;
		stop the action;
	end if.

Instead of searching the parking lot window: 
	say "Through the window, you make out [the other side of the parking lot window].".

Instead of asking someone (called X) for something (called Y):
	if (X is alive) begin;
		say "[X] gave you the [Y]";
		now the player carries Y;
	end if.

Instead of examining the watch:
	say "It's [time of day].".

Instead of asking someone about something:
	if the noun is safe_unlocker and the noun is alive and the topic understood matches "the password" begin;
		say "Now you know the password. Just go to the safe's door and open it.";
		now the player is safe_unlocker;
	otherwise;
		continue the action;
	end if.

After asking the manager about "the safe", say "It is after the security room. You need to unlock the security room before trying to open the safe.".

Instead of inserting something (called X) into something (called Y):
	if X is heavy and Y is a container begin;
		if Y is huge begin;
			if Y does not contain something begin;
				now Y contains X;
				say "Now [Y] contains [X].";
			otherwise;
				say "[Y] must be empty.";
			end if;
		otherwise;
			say "[X] is too heavy. [Y] cannot handle.";
		end if;
	otherwise;
		continue the action;
	end if.

Instead of dropping the gun:
	say "It seems a bad idea.";
	stop the action.

Instead of dropping the mobile:
	say "It seems a bad idea.";
	stop the action.

Instead of asking a dead person about something:
	say "[the noun] is dead.";
	stop the action.

Instead of asking a dead person for something:
	say "[the noun] is dead.";
	stop the action.

After unlocking a door (called X) with a thing:
	now X is open;
	continue the action.

After unlocking a vehicle (called X) with a thing:
	now X is open;
	continue the action.

After unlocking the front door with a thing:
	display Figure of death;
	end the game saying  "The cops killed you!".

Every turn when location is the empty street:
	if  the player carries bag and bag contains lot of money begin;
		end the game in victory;
	otherwise;
		end the game saying "You scaped without any penny! You're family is dead!";
	end if.

Every turn when location is the main street:
	end the game saying "Busted!".

Every turn when a alive hostage (called X) is in the second floor:
	say "[X] has been released.";
	award 3 point;
	now X is in the main street.
